//规定了表的基础功能
#ifndef __VIRTUALLINKEDLIST__H
#define __VIRTUALLINKEDLIST__H

#include"../Universal.h"

namespace NgSiuKei {

template<class TheClass>
class VirtualLinkedList {
    public:
    VirtualLinkedList(void);
    ~VirtualLinkedList(void);

    public:
    //判空
    bool isEmpty(void) const;
    //表大小
    const U_L_L getSize(void) const;

    public:
    //清空
    virtual void clear(void) = 0;
    //获取特定下标的元素值
    virtual TheClass getVal(const U_L_L &index) const = 0;
    //查找数据，返回下标，表没有则抛出异常：EXCEPTION_IS_EMPTY
    virtual U_L_L findVal(const TheClass &val) const = 0;
    //插入数据
    virtual void insertVal(const TheClass &val, const U_L_L &index) = 0;
    //删除特定下标的元素，返回元素值
    virtual TheClass deleteWithIndex(const U_L_L &index) = 0;
    //打印表
    virtual void print(void) = 0;

    protected:
    U_L_L size;
};

template<class TheClass>
VirtualLinkedList<TheClass>::VirtualLinkedList(void) {
    this->size = 0;
};

template<class TheClass>
VirtualLinkedList<TheClass>::~VirtualLinkedList(void) {
    
};

template<class TheClass>
bool VirtualLinkedList<TheClass>::isEmpty(void) const {
    return 0 == this->size;
}

template<class TheClass>
const U_L_L VirtualLinkedList<TheClass>::getSize(void) const {
    return this->size;
}

};

#endif